package com.pactera.commons;


public class RestException extends RuntimeException {
    private static final long serialVersionUID = -2365683334848201701L;
    private final int code;

    public RestException(int code, String msg) {
        super(msg);
        this.code = code == RestStatus.SUCCESS.code() ? RestStatus.OTHER_ERROR.code() : code;
    }

    public RestException(String msg) {
        super(msg);
        this.code = RestStatus.OTHER_ERROR.code();
    }

    public int getCode() {
        return this.code;
    }

    public String getMsg() {
        return super.getMessage();
    }
}
